<?php
defined('IN_GoogleCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class depart_account_model extends model {
	public $table_name = '';
	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'depart_account';
		parent::__construct();
	}
	public function edit_content($data,$id) {
	
	$require_items = array('userid','username','email','contactname','telephone','trade_sn','price','quantity','addtime','paytime','usernote','usernote','pay_type','pay_id','payment','ip','status','fox','address','catid','catname');
		if(is_array($data)) {
			foreach($data as $key=>$item) {
				if(in_array($key,$require_items)) $info[$key] = $item;
			}			
		} else {
			return false;
		}
		//$trade_exist = $this->account_db->get_one(array('id'=>$info['id']));
		//if($trade_exist) return $trade_exist['id'];
		//print_r($info);
		//$this->account_db->update($info);
		$this->update($info,array('id'=>$id));
		return true;
	}
}
?>